﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Utils.DCSControl;
using System.Data;
using DCSLibrary;

public partial class Module_Product_san_pham_category_level_1 : System.Web.UI.UserControl
{
    dcPage page;
    ProductUI objProduct = new ProductUI();
    DataSet dsProduct;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            page = (dcPage)this.Page;
            if (page.PageSettings.HasEntry)
            {
                DataTable dt = page.PageSettings.Entry;
                grdProductDetails.DataSource = dt;
                grdProductDetails.DataBind();
            }
            else
            {
               BindProduct();
            }
        }
    }

    protected void pagerChanging(object sender, PagePropertiesChangingEventArgs e)
    {
        pgProduct.SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
        BindProduct();
    }

    private void BindProduct()
    {
        dsProduct = objProduct.GetAll();
        grdProduct.DataSource = dsProduct;
        grdProduct.DataBind();
    }
}
